package player.ui;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.Rectangle;

import player.core.MediaInfo;

public class VideoLayout implements LayoutManager{
	MediaInfo mi;
	VideoPanel videoPanel;
	VideoCanvas videoCanvas;
	ThumbPanel ThumbPanel;
	VideoLayout(VideoPanel videoPanel,VideoCanvas videoCanvas,ThumbPanel ThumbPanel){
		this.videoPanel=videoPanel;
		this.videoCanvas=videoCanvas;
		this.mi=mi;
		this.ThumbPanel=ThumbPanel;
	}
	
	public void addLayoutComponent(String arg0, Component arg1) {
		
	}

	public void removeLayoutComponent(Component c) {
		
	}
	
	public void layoutContainer(Container c) {
		setVideoCanvas();
	}
	
	void setVideoCanvas(){
		if(videoPanel==null|videoCanvas==null){
			return ;
		}
		Rectangle recCanvas=new Rectangle(10,10,videoPanel.getWidth()-20,videoPanel.getHeight()-20);
		videoCanvas.setBounds(recCanvas);
		
		Rectangle rec2=new Rectangle(20,20,videoPanel.getWidth()-50,videoPanel.getHeight()-50);
		ThumbPanel.setBounds(rec2);
		
	}
	

	public Dimension minimumLayoutSize(Container c) {
		Dimension dm=new Dimension(0,0);
		return dm;
	}

	public Dimension preferredLayoutSize(Container c) {
		Dimension dm=new Dimension(50,50);
		return dm;
	}
}
